/*******************************************************************************
 * Copyright (c) 2022, 2022
 ******************************************************************************/
package com.alex.demo.kafka.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Version 1.0
 * @Author Alex
 * @Created Dec 2022/9/20 15:13
 * @Description
 *              <p>
 */
@RestController
@RequestMapping("/producer")
public class ProducerController {

	@Autowired
	KafkaTemplate<String, String> kafka;

	@PostMapping("/send")
	public void send(String msg) {
		kafka.send("topic", msg);
	}
}
